<template>
  <div class="banxin2">
    <div class="box"
         v-for="item,index in djProgramList"
         :key="index">
      <div class="title">
        <h3>{{ item.title }} · 电台</h3>
        <p>更多 ></p>
      </div>
      <div class="box-child">
        <div class="content"
             v-for="ite,inde in item.children"
             :key="inde">
          <img :src="ite.url"
               alt="">
          <div class="right">
            <h2>{{ite.name}}</h2>
            <p>{{ ite.intro }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { djProgram } from '@/assets/js/request'
export default {
  data() {
    return {
      djProgramList: [
        {
          title: '音乐推荐',
          children: [{ url: '', name: 'asda', intro: '15645' }],
        },
        {
          title: '生活',
          children: [{ url: '', name: '7789', intro: '15645' }],
        },
      ],
    }
  },
  created() {
    djProgram().then((res) => {
      console.log(res)
    })
  },
}
</script>

<style lang="less" scoped>
@import '@/assets/css/base.less';
.banxin2 {
  background-color: #fff;
  border: 1px solid #ccc;
  text-align: left;
  padding: 20px;
  box-sizing: border-box;
  .box {
    margin-top: 20px;
    .title {
      line-height: 27px;
      border-bottom: 1px solid #c20c0c;
      h3 {
        font-size: 24px;
        color: #000;
        display: inline-block;
      }
      p {
        float: right;
        color: #666;
        font-size: 12px;
        cursor: pointer;
        &:hover {
          text-decoration: underline;
        }
      }
    }
    .box-child {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      column-gap: 10px;
      .content {
        border-bottom: 1px solid #ccc;
        padding: 20px 0;
        width: 435px;
        height: 160px;
        box-sizing: border-box;
        &:last-child(2) {
          border-bottom: none;
        }
        img {
          width: 120px;
          height: 120px;
          vertical-align: top;
        }
        .right {
          display: inline-block;
          margin-left: 20px;
          line-height: 40px;
          h2 {
            margin-top: 16px;
            font-size: 18px;
            font-weight: 600;
          }
          p {
            color: #999;
            font-size: 12px;
          }
        }
      }
    }
  }
}
</style>